package com.chennan.project.api.rest.controller;

import com.chennan.common.domian.ResponseData;
import com.chennan.project.api.rest.controller.dto.HandleClickDTO;
import com.chennan.project.domain.service.impl.WuzqServiceImpl;
import com.chennan.websocket.domain.model.User;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.messaging.handler.annotation.MessageMapping;
import org.springframework.web.bind.annotation.*;

/**
 * @author chennan
 * @createTime 2021年08月03日 14:41:00
 */
@Api(tags = "五子棋后端接口")
//@RestController
//@RequestMapping("/wuzq")
public class WuzqController {

    @Autowired
    private WuzqServiceImpl wuzqService;

    @PostMapping("/initwuziq/{username}")
    public ResponseData initWuziqi(@PathVariable("username") String username){
        wuzqService.initWuziqi(username);
        return ResponseData.SCESSES;
    }

    @MessageMapping("/luozi")
    public ResponseData luozi(@RequestBody HandleClickDTO handleClickDTO){
        wuzqService.luozi(handleClickDTO);
        return ResponseData.SCESSES;
    }



}
